function Node(name) 
{
	this.centerX = 0;
	this.centerY = 0;
	this.name = name;
	this.class = "Unknown";
	
	context.font="12px Arial";
	this.width = context.measureText(this.name).width + 40;
	this.height = 50;
	
	this.draw = function() {
		context.lineWidth = 1;
		if (this.class == "Message") {
			context.fillStyle = "#F00000";
		} else {
			context.fillStyle = "#00C800";
		}

		context.fillRect(this.centerX+0.5-this.width/2,this.centerY+0.5-this.height/2, this.width, this.height);			
		context.strokeRect(this.centerX-this.width/2, this.centerY+0.5-this.height/2, this.width, this.height);
		context.textAlign="center";
		context.fillStyle="black";
		context.font="12px Arial";
		context.fillText(this.name, this.centerX, this.centerY+5);
	}
	
	this.setCenterPosition = function(x,y) { 
		this.centerX = x;
		this.centerY = y;
	}

	this.onclick = function(e) {
		var mx = e.clientX-canvas.offsetLeft-translationX;
		var my = e.clientY-canvas.offsetTop-translationY;
		if (mx > this.centerX-this.width/2 && mx < this.centerX+this.width/2 &&
		    my > this.centerY-this.height/2 && my < this.centerY+this.height/2)
		{
			AnimateCenteredAt(this.centerX, this.centerY);
			// TODO
		}
	}
}